package com.frostmourne.mxsguimaker.commands.sub;

import com.frostmourne.mxsguimaker.MXSGuiMaker;
import com.gitee.mxstarsex.objects.builders.bukkit.commands.CommandElement;
import com.gitee.mxstarsex.objects.builders.bukkit.commands.SubCommandBase;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ReloadCommand extends SubCommandBase {
    public ReloadCommand() {
        super("reload", "server.admin");
        setAlias(new ArrayList<>(
                Arrays.asList(
                        "r","load","re","重载"
                )
        ));
    }

    @Override
    public void run(CommandElement commandElement) {

        if (!commandElement.getSender().isOp()){
            return;
        }
        MXSGuiMaker.INSTANCE.load();
        commandElement.sendMessage("重载完成");

    }

    @Override
    public List<String> tabExecute(CommandElement commandElement) {
        return new ArrayList<>();
    }
}
